<template>
  <view class="container">
    <view class="top-box">
      <view class="type">{{ item.category_name }}</view>
      <view class="title">{{ item.title }}</view>
    </view>
    <view class="status-container" v-if="status == 1">
      <view class="content-item" @click="operate(1, item)">
        <image src="../../static/my-img/bottom.png" mode="scaleToFill" />
        <text>下架</text>
      </view>
      <view class="content-item" @click="operate(2, item)">
        <image
          v-if="!item.iszhiding"
          src="../../static/my-img/top-icon.png"
          mode="scaleToFill"
        />
        <image
          v-else
          src="../../static/my-img/top-icon_.png"
          mode="scaleToFill"
        />
        <text
          :style="{
            color: item.iszhiding == 1 ? '#4c9ffb' : '',
          }"
          >{{ item.iszhiding == 1 ? "置顶中" : "置顶" }}</text
        >
      </view>
      <view class="content-item" @click="operate(3, item)">
        <image src="../../static/my-img/refresh-icon.png" mode="scaleToFill" />
        <text>刷新</text>
      </view>
      <view
        class="content-item"
        @click="operate(4, item)"
        v-if="item.issyxm == 0"
      >
        <image src="../../static/my-img/shang-top.png" mode="scaleToFill" />
        <text>上押</text>
      </view>
      <view class="content-item" v-if="item.issyxm == 1">
        <image src="../../static/my-img/deposit-icon.png" mode="scaleToFill" />
        <text style="color: #fe4e1d">已上押</text>
      </view>
      <view class="content-item" @click="operate(5, item)">
        <image src="../../static/my-img/zidong.png" mode="scaleToFill" />
        <text>自动刷新</text>
      </view>
    </view>
    <view class="status-container-one" v-if="status == 2">
      <view class="content-item" @click="operate(6, item)">
        <image src="../../static/my-img/shangjia.png" mode="scaleToFill" />
        <text>上架</text>
      </view>
    </view>
    <view class="content" v-if="status == 9">
      <view class="title"> 删除原因 </view>
      <view class="details">{{ item.bhyy }} </view>
    </view>
    <view class="content" v-if="status == 0">
      <view class="status">
        <u-icon size="20" name="clock"></u-icon>
        <text>帖子正在审核中...</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    status: {
      type: String,
    },
    item: {
      type: Object,
    },
  },
  data() {
    return {};
  },
  methods: {
    operate(index, item) {
      console.log(item);
      this.$emit("operate", index, item);
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  box-shadow: 10rpx 10rpx 10rpx rgba(255, 255, 255, 0.3);
}
.top-box {
  background-color: #fff;
  padding: 0 20rpx;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 100rpx;
  .type {
    font-size: 24rpx;
    // width: 60rpx;
    text-align: center;
    margin-right: 20rpx;
    padding: 0 20rpx;
    box-sizing: border-box;
    height: 40rpx;
    color: #4c9ffb;
    border: 1rpx solid #4c9ffb;
  }
  .title {
    font-size: 28rpx;
  }
}
.content {
  background-color: #f7f8fc;
  border-radius: 0 0 10rpx 10rpx;
  padding: 20rpx;
  box-sizing: border-box;
  margin-bottom: 40rpx;
  .title {
    font-size: 22rpx;
  }
  .details {
    font-size: 27rpx;
    margin-left: 10rpx;
  }
  .status {
    display: flex;
    align-content: center;
    text {
      color: #93939b;
      font-size: 22rpx;
      margin-left: 20rpx;
    }
  }
}
.status-container {
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 20rpx 0;
  box-sizing: border-box;
  margin-bottom: 20rpx;
  .content-item {
    display: flex;
    align-items: center;
    text {
      font-size: 26rpx;
    }
  }
  image {
    width: 38rpx;
    height: 38rpx;
    margin-right: 15rpx;
  }
}
.status-container-one {
  background-color: #fff;
  display: flex;
  align-items: center;
  padding: 20rpx 0;
  box-sizing: border-box;
  margin-bottom: 20rpx;
  .content-item {
    display: flex;
    text {
      font-size: 26rpx;
    }
  }
  image {
    width: 38rpx;
    height: 38rpx;
    margin-left: 30rpx;
  }
}
</style>
